package com.jk.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jk.po.DestinationPO;
import com.jk.vo.AreaVO;
import com.jk.vo.CustomerVO;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DestinationDao extends BaseMapper<DestinationPO> {

    /**
     * @author 段卓帆
     * @date 2021/7/1 15:27
     * @return 查询景区价格从低到高
     */
    @Select(value=" SELECT * FROM travel_area ORDER BY areaprice ")
    List<DestinationPO> queryByPrice();
    /**
     * @author 段卓帆
     * @date 2021/7/1 15:27
     * @return 查询景区价格从高到低
     */
    @Select(value=" SELECT * FROM travel_area ORDER BY areaprice DESC")
    List<DestinationPO> queryByPriceDesc();
    /**
     *
     *
     * @author 赵磊荣
     * @date 2021/7/1 15:30
     * @return 热度排序
     */
    @Select(value="SELECT * FROM travel_area a ORDER BY a.areaheat  DESC")
    List<DestinationPO> finddestinationheat();
    /**
     *
     *
     * @author 赵磊荣
     * @date 2021/7/1 15:42
     * @return 等级排序
     */
    @Select(value="SELECT * FROM travel_area a ORDER BY a.arealevel  DESC")
    List<DestinationPO> finddestinationlevel();


    /**
     *
     *
     * @author 赵磊荣
     * @date 2021/7/5 20:02
     * @return 目的地查询
     */
    @Select(value = " SELECT * FROM area ")
    List<AreaVO> queryAreaList();



    @Select(value = " SELECT * FROM travel_area  ta left join area a on a.aid = ta.taid ")
    List<AreaVO> queryAreaAndTAList();



    @Select(value = "SELECT * FROM travel_area  ta left join area a on a.aid = ta.taid where ta.taid = #{taid}")
    AreaVO queryAreaAndTAByTaid(Integer taid);
}
